<?php

/*

  Action – Duration	$4

  +1 Card; +1 Action
  At the start of your next turn, +1 Card.

 */

class Caravan extends Card implements iAction, iKingdom, iDuration, iSeaside {

    public function __construct() {
        parent::__construct("Caravan", 4);
        $this->duration = 1;
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDescription() {
        return array(
            "+1 Card",
            "+1 Action",
            "At the start of your next turn, +1 Card.");
    }
    
    public function play(Game $game, $isRealCard) {
        $drawed_cards = $game->drawCards(1);
        $game->addActions(1);
        $game->pushCardToDurationAffects($this, 1, $isRealCard);
         ScreenDisplay::addScreenMessage($game, true, "get +1 action  and draw " . nicePrint($drawed_cards), "gets +1 action and  draws " . sizeof($drawed_cards) . " cards");
		 $game->cardActionFinished();
        return true;
    }
    
    public function cleanup(Game $game) {
        $game->moveCardFromPileToPile($this, PlayArea, DurationPileCards);
    }

    public function startTurn(Game $game, $quantity) {
        $drawed_cards = $game->drawCards(1);
         ScreenDisplay::addScreenMessage($game, true, "activate  ".  nicePrint($this)." and draw " . nicePrint($drawed_cards), "activates ".  nicePrint($this)." and  draws " . sizeof($drawed_cards) . " cards");
        if ($quantity > 0)
            return RETURN_DURATION_TO_DISCARD;
        else 
            return DELETE_VIRTUAL_DURATION_CARD;
    }

}

?>